/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2017-07-21 11:42:21
 * @Copyright: 2017 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.gshop.pbpm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.itttq.gshop.domain.po.OrderRefundPo;
import com.itttq.gshop.domain.to.ResultPageTo;
import com.itttq.gshop.pbpm.mapper.IOrderRefundMapper;

@Service
public class OrderRefundService {
	@Autowired
	private IOrderRefundMapper orderRefundMapper;
	
	/**
	 * 根据ID获取OrderRefundPo对象
	 * 
	 * @param id
	 * @return
	 * @Author 迷蝶
	 * @return OrderRefundPo
	 */
	public OrderRefundPo getOrderRefund(int id) {
		return orderRefundMapper.findOrderRefundById(id);
	}
	
	/**
	 * 根据条件获取OrderRefundPo对象，并返回查询的数据总数
	 * 
	 * @param orderRefund
	 * @Author 迷蝶
	 * @return ResultPageTo<OrderRefundPo>
	 */
	public ResultPageTo<OrderRefundPo> getOrderRefunds(OrderRefundPo orderRefund) {
		return new ResultPageTo<OrderRefundPo>(orderRefund.getStart(), orderRefund.getSize(), 
				orderRefundMapper.findOrderRefundCount(orderRefund), orderRefundMapper.findOrderRefunds(orderRefund));
	}
	
	/**
	 * 根据ID删除OrderRefundPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 */
	public Integer delOrderRefund(int id) {
		return orderRefundMapper.delOrderRefundById(id);
	}
	
	/**
	 * 增加OrderRefundPo对象
	 * 
	 * @param orderRefund
	 * @Author 迷蝶
	 */
	public Integer addOrderRefund(OrderRefundPo orderRefund) {
		return orderRefundMapper.addOrderRefund(orderRefund);
	}
	
	/**
	 * 根据条件更新OrderRefundPo对象
	 * 
	 * @param orderRefund
	 * @Author 迷蝶
	 */
	public Integer updateOrderRefund(OrderRefundPo orderRefund) {
		return orderRefundMapper.updateOrderRefund(orderRefund);
	}
	
}
